package com.hg.onlineshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hg.onlineshop.entity.Comment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentMapper extends BaseMapper<Comment> {

    @Select("select * from comment_t ct join user_t ut on ct.member_id = ut.id where ct.product_id = #{productId}")
    List<Comment> selectCommentsByProductId(@Param("productId") Integer productId);
}
